<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="选择制作要求" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	
	function doSelect(index){
		var ob_arr = document.getElementsByName("query_checkbox");
		var arr=new Array();
		if ( ob_arr.length>=index ){
			arr[0]=new Array(ob_arr[index-1].value);
			parent.popRetVal=arr;
		}
		parent.ClosePop();
	}
	
	function DoubleClick(it){
		var ob_arr = document.getElementsByName("query_checkbox");
		var arr=new Array();
		if(ob_arr.length>=it.getAttribute("index")){
			arr[0]=new Array(ob_arr[it.getAttribute("index")-1].value);
			parent.popRetVal=arr;
		}
		parent.ClosePop();
	}
	function doMutiSelect(){
		var ob_arr = document.getElementsByName("query_checkbox");
		var arr=new Array();
		for (i=0;i<ob_arr.length;i++){
			if ((ob_arr[i].checked == true)){
				arr.push(new Array(ob_arr[i].value,"1"));
			}
		}
		if(arr.length>0){
			parent.popRetVal=arr;
			parent.ClosePop();
		}else{
			ShowAlert('提示框','请选择制作要求！',200,100);
			return;
		}
	}
	function doCancel(){
		parent.ClosePop();
	}
	function doInit(){
		//Window_Onload();
		document.getElementById("search_key").focus();
	}
	function checkSearchKey(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
	function doSearch(){
		var searchKey=encodeURIComponent(document.getElementById("search_key").value.trim());
		window.location="/base/MakeRequireListForSelect.ihtm?search_key="+searchKey;
	}
</script>
</head>
<body oncontextmenu="return false" onload="doInit();"  class="sheet">
<div class="sheet-main" style="width:856px">
  <div class="sheet-top">
    <div class="content">
      <h2>选择制作要求</h2>
      <p>鼠标双击可以选中记录</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
    	<div class="content">
	        <table width="748">
	          <tbody>
	            <tr>
	              <td  align="right">
	              	<input type="text" class="TextBox" id="search_key" name="search_key" onKeyUp="checkSearchKey();" value="<c:out value="${searchKey}" />" title="可以根据编号、制作要求进行模糊查询">
					<input type="button" class="buttom search-but" value=" 查 询" onClick="doSearch();" title="可以根据编号、制作要求进行模糊查询">
					<input type="button" class="buttom search-select" value=" 选 择" onClick="doMutiSelect();">
				  </td>
	            </tr>    
	           </tbody>      
	        </table>
	      </div>
	     <div class="table-list">
	        <table width="100%">
	        	<tr>
					<th width="14"></th>
					<th width="15%">编号</th>
					<th width="75%">制作要求</th>
					<th width="10%">操作</th>
				</tr>
				<c:forEach var="item" items="${makeRequireList}" varStatus="i">
					<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
					<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
					<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this,true)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
						<td><input type="checkbox" onClick="javascript:ClickCheck(this,true);" name='query_checkbox' value="<c:out value="${item.requireContent}" />"></td>
						<td>${item.code}</td>
						<td>${item.requireContent}</td>
						<td>
							<a href="javascript:doSelect('${i.index+1}');">选择</a>
						</td>
					</tr>
				</c:forEach>
			</table>
	     </div>  
	   </div>  
  </div>
 	<div class="blank12"></blank>
</div>
</body>
</html>